/**
 * @author：anlzou
 * @Date：Created in2:29 2021/4/11
 * @Github：https://github.com/anlzou
 * @Description：
 */
package com.anlzou.junit5Demo;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Timeout;


public class RuleTestDemo {
    //使用Timeout这个Rule
    @Rule
    public Timeout timeout = new Timeout(1000);

    @Test
    public void testMethod1() throws Exception {
        Thread.sleep(1001);
    }

    @Test
    public void testMethod2() throws Exception {
        Thread.sleep(999);
    }

    //使用自定义Rule，
    @Rule
    public MethodNameRule methodNameRule = new MethodNameRule();
}
